package com.example.ljw.paperlive.base;

import android.app.Application;

import com.bumptech.glide.Glide;
import com.bumptech.glide.integration.okhttp.OkHttpUrlLoader;
import com.bumptech.glide.load.model.GlideUrl;
import com.example.ljw.paperlive.utils.OkHttpClientHelper;
import com.squareup.okhttp.OkHttpClient;

import java.io.InputStream;

import cn.smssdk.SMSSDK;


/**
 * Created by LJW on 2016/11/23.
 */

public class App extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        initSMS();
        initGlide();
        initOkhttp();
    }

    private void initSMS(){
        SMSSDK.initSDK(this,"196c723047b26","34e861f2cbe58c38d9ca9249eb2eeb85");
    }
    //初始化okhttp
    private void initOkhttp() {
        OkHttpClient okHttpClient= OkHttpClientHelper.getOkHttpSingletonInstance();
    }

    //初始化Gilide并且把glide连接方式设置为okhttp
    private void initGlide() {
        Glide.get(this)
                .register(GlideUrl.class,InputStream.class,
                        new OkHttpUrlLoader.Factory(OkHttpClientHelper.getOkHttpSingletonInstance()));

    }

}

